<?php

class Default_Form_Module extends Zend_Form
{
    public function __construct()
    {
        parent::__construct($options);
        $this->setName('Object');

        $this->addElement('text', 'weight', array(
            'label'      => 'Svars:',
            'required'   => false,
            'filters'    => array(
                'StripTags',
                'StringTrim'
            ),
            'validators' => array(
                'float'
                )
            )
        );

        $objects = new My_Object();
        $objects = $objects->getAll();

        if(is_array($objects)){
            foreach($objects AS $object){
                $object = new My_Object($object);
                $select[$object->getId()] = $object->getName();
            }
        }

        $this->addElement('select', 'object',
            array(
                'label'     => 'Objekts:',
                'filters'   => array('StringTrim', 'StripTags', 'StringToLower'),
                'required'  => true,
                'multiOptions' => $select,
                'value'   => $selected
            )
        );

        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Saglabāt',
        ));

    }

}